<!--#include file="../../../easyasp/easp.asp" -->
<%'Response.ContentType="application/json;charset=utf-8"
Response.AddHeader "content-type","application/json" 
%>

<%
Dim File,F
Easp.Upload.AllowFileTypes = "jpg|png|gif"
Easp.Upload.AllowMaxFileSize = "1MB"
Easp.Upload.AllowMaxSize = "20mb"
Easp.Upload.CharSet = "utf-8"
if not Easp.Upload.GetData() then 
	Easp.PrintEnd Easp.Upload.Description
else
	Easp.Upload.SavePath = "/_upload"
	'Easp.Println "<b>保存所有文件： </b>"
	
	dim Json
	Set Json = Easp.Json.NewObject
	Json("errno") = Easp.Json.NewObject
	
	Json("errno") = 0 
	Json("data") = Easp.Json.NewArray 
	
		dim i:i=0
			for each file in Easp.Upload.Files("-1")
				Set F = Easp.Upload.Save(file,0,true)
				if F.Succeed then
					'Easp.Println "文件'" & F.LocalName & "'上传成功，保存位置'" & F.Path & F.filename & "',文件大小" & F.size & "字节"
					Json("data["&i&"]") ="http://stzyhd.com"&F.Path & F.filename
					
						i=i+1
				else
					Easp.Println F.Exception
				end if		
			next
			
			
			Easp.Print Json.ToString()
			Set Json = Nothing
end if



%>
